<style>
    body {
        padding: 0px;
        margin: 0px;
    }
</style>
<div id="d1">Hello1</div><div id="d2">Hello2</div>
<style>
    div {
        display: inline-block;
        border: 1px solid red;
        width: 100px;
        height: 100px;
    }
    /* 左右外间距累加 20px */
    #d1 {
        margin-right: 10px;
    }
    #d2 {
        margin-left: 10px;
    }
</style>